<?php include('./templete/public/head.php')?>
<body>
<!--金点子排行-->
<div class="idea-rank-main">
    <img src="_images/rank-bg.jpg" class="rank-bg" />
    <div class="rank-content">
        <div class="c-bot">
            <div class="mui-slider">
                <div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">

                    <div class="mui-slider-group">
                        <!--1-->
                        <div  class="mui-slider-item mui-control-content mui-active">
                            <div class="mui-scroll-wrapper">
                                <div class="mui-scroll">
                                    <ul>
                                        <?php foreach ($list as $k=>$v){?>
                                        <li class="rank-item">
                                            <img src="<?php echo $v['user']['avatar']?>" class="head-img" />
                                            <div class="progress" id="progress<?php echo $k?>">
                                                <p><?php echo $v['user']['name']?>
                                                    <span class="integral"><?php echo $v['integral']?></span>
                                                </p>
                                                <p class="mui-progressbar mui-progressbar-in"><span></span></p>
                                            </div>
                                        </li>
                                        <?php }?>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    $(function(){
        $(".top_nav a").on("click",function(){
            var index=$(this).index();
            $(this).addClass("mui-active").siblings().removeClass("mui-active");
            $(".mui-slider-item").eq(index).addClass("mui-active").siblings().removeClass("mui-active");
        })
    })
</script>
<script>
    //进度
    (function() {
        var progressbar1 = $("[id^='progress']");// mui('#progress^');
        var first = $('#progress0').find('.integral').text();
        for(var i=0;i<progressbar1.length;i++) {
            let integral = $('#progress'+i).find('.integral').text();

            mui(progressbar1[i]).progressbar().setProgress(integral*100/first)
        }
    })(mui);
</script>
</html>